package com.ruoyi.web.controller.hospital;

import com.ruoyi.community.service.hospital.OtherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/other/")
public class OtherController
{
    @Autowired
    OtherService otherService;

    @GetMapping("/getRole/{open_id}")
    public int getRole(@PathVariable String open_id)
    {
        return otherService.getRole(open_id);
    }

    @GetMapping("/registerUser/{role}/{community_id}/{open_id}/{name}/{age}/{phoneNumber}")
    public String registerUser(@PathVariable String community_id, @PathVariable String age, @PathVariable String name, @PathVariable String open_id, @PathVariable String phoneNumber, @PathVariable String role)
    {
        return otherService.registerUser(community_id, age, name, open_id, phoneNumber, role);
    }

    @GetMapping("/forwardStage/{open_id}")
    public void forwardStage(@PathVariable String open_id)
    {
        otherService.forwardStage(open_id);
    }
}
